import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../services/httpsClient.dart';

class RegisterStepOneController extends GetxController {
  //TODO: Implement RegisterStepOneController

  // 获取请求实例
  HttpsClient httpsClient = HttpsClient();

  // 定义文本控制器
  TextEditingController editingController = TextEditingController();

  // 手机号
  var phonNum = '';
  @override
  void onInit() {
    super.onInit();
  }

  @override
  void onClose() {
    super.onClose();
  }

// 发送验证码
  Future<bool> sendCode() async {
    var res = await httpsClient
        .post("/api/sendCode", data: {"tel": editingController.text});
    if (res != null) {
      if (res.data['success'] == true) {
        print(res.data);
        return true;
      } else {
        return false;
      }
    } else {
      return false;
    }
  }
}
